using System;
using System.Collections.Generic;
using System.Text;

namespace Horizon
{
    /// <summary>
    /// A Horizon Information Portal server request for any operation
    /// </summary>
    public class ServerRequest
    {
        string menuValue = "search",         // Default for a basic search
            submenuValue,   // Default for a basic search
            aspectValue = "basic_search",        // Default for a basic search
            locationValue,     // Key to link holding to library (Coralville Public Library)
            nppValue = "50",   // Search results per "page"
            ippValue = "20",   // 
            sppValue = "20",   // 
            riValue,           // Results index?  As in which "page" of results...
            termValue,         // Term to be searched
            sourceValue,       // ~!horizon
            limitValue,        // Limit to fiction, non-fiction, children, etc. CO01+%3D+co_newnf (limitbox_1)
            sortValue,         // 3100014
            matchOptionValue,  // 0%7C0
            indexValue;        // PALLTI, PAUTHOR, PSUBJ (multiple if specify attribute each time)

        public ServerRequest()
        {
        }

        /// <summary>
        /// Constructs a request given a menu, submenu, and aspect string
        /// </summary>
        /// <param name="menu">Menu value for this request</param>
        /// <param name="submenu">Submenu value for this request</param>
        /// <param name="aspect">Aspect for this request</param>
        public ServerRequest(string menu, string submenu, string aspect)
        {
            this.menuValue = menu;
            this.submenuValue = submenu;
            this.aspectValue = aspect;
        }

        #region "Public Properties"
        public string Index
        {
            get { return indexValue; }
            set { indexValue = value; }
        }

        public string MatchOption
        {
            get { return matchOptionValue; }
            set { matchOptionValue = value; }
        }

        public string Sort
        {
            get { return sortValue; }
            set { sortValue = value; }
        }

        public string Limit
        {
            get { return limitValue; }
            set { limitValue = value; }
        }

        public string Source
        {
            get { return sourceValue; }
            set { sourceValue = value; }
        }

        public string SearchTerm
        {
            get { return termValue; }
            set { termValue = value; }
        }

        public string RI
        {
            get { return riValue; }
            set { riValue = value; }
        }

        public string IPerPage
        {
            get { return ippValue; }
            set { ippValue = value; }
        }

        public string SPerPage
        {
            get { return sppValue; }
            set { sppValue = value; }
        }

        public string NumberPerPage
        {
            get { return nppValue; }
            set { nppValue = value; }
        }

        public string Location
        {
            get { return locationValue; }
            set { locationValue = value; }
        }

        /// <summary>
        /// Aspect of this screen that should be invoked (think of "operation") (i.e. "basic_search)
        /// </summary>
        public string Aspect
        {
            get { return aspectValue; }
            set { aspectValue = value; }
        }

        /// <summary>
        /// Screen submenu whose functionality should be invoked
        /// </summary>
        public string Submenu
        {
            get { return submenuValue; }
            set { submenuValue = value; }
        }

        /// <summary>
        /// Screen menu whose functionality should be invoked (i.e. "search")
        /// </summary>
        public string Menu
        {
            get { return menuValue; }
            set { menuValue = value; }
        }
        #endregion
    }
}
